#include <stdio.h>
#include <string.h>

typedef struct{
char id[20];
char name[20];
int ch1,ch2,ch3;
}student;

void input(student *p)
{
	char temp[100];
	fgets(temp,sizeof(temp),stdin);
	char *pos=strchr(temp,'\n');
	*pos='\0';
	sscanf(temp,"%19s %19s %d %d %d",p->id,p->name,&p->ch1,&p->ch2,&p->ch3);
}

void print(student *s)
{
	printf("%s,%s,%d,%d,%d\n",s->id,s->name,s->ch1,s->ch2,s->ch3);
}

int main()
{
	student students[100];
	int n;
	scanf("%d",&n);
	getchar();
	int i;
	for(i=0;i<n;i++)
	{
		input(&students[i]);
	}
	for(i=0;i<n;i++)
	{
		print(&students[i]);
	}
	return 0;
}